home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18266 < prev    next >
Encoding:
Text File  |  1996-08-05  |  719 b   |  39 lines

  1. Path: taco.cc.ncsu.edu!easchwei
  2. From: easchwei@unity.ncsu.edu (Eric)
  3. Newsgroups: gnu.g++.help,comp.lang.c++
  4. Subject: template bug?
  5. Date: 19 Apr 1996 14:46:39 GMT
  6. Organization: North Carolina State University
  7. Message-ID: <4l890f$177@taco.cc.ncsu.edu>
  8. NNTP-Posting-Host: styx.csc.ncsu.edu
  9.  
  10. Given the following code:
  11.  
  12.  
  13.     template <class T>
  14.     class C {
  15.           typedef C<T>* CPTR;
  16.        public:
  17.           int func( CPTR );
  18.     };
  19.  
  20.     template <class T>
  21.     int C<T>::func( C<T>::CPTR cp )
  22.     {
  23.        return 0;
  24.     }
  25.  
  26.  
  27. I get the following warnings/errors:
  28.  
  29.     test.cc:10: incomplete type `C<...>' does not have member `CPTR'
  30.     test.cc:10: parse error before `)'
  31.  
  32.  
  33. The same code compiles fine without the template stuff removed.
  34.  
  35. What gives?
  36.  
  37. --
  38. Eric
  39.